<%@ Page Language="C#" MasterPageFile="~/Admin/admin.master" AutoEventWireup="true" EnableEventValidation="false"
    CodeFile="SendInvoice.aspx.cs" Inherits="Admin_SendInvoice" Title="Send Invoice" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    Check Invoice List</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <asp:Panel runat="server" ID="pn_Add" DefaultButton="btn_Receive">
                <table>
                    <tr>
                        <td>
                            Company Name:
                        </td>
                        <td colspan="2">
                            <data:EntityDropDownList runat="server" ID="ddl_Company" AppendNullItem="True" CaseSensitiveKeySort="False"
                                NullItemText="...Please select Company..." DataSourceID="AbAccountCodeDataSource1"
                                DataValueField="KindPment" DataTextField="AccName" EnableClientScript="True"
                                ReadOnly="False" Required="False" AutoPostBack="True" OnSelectedIndexChanged="ddl_Company_SelectedIndexChanged">
                            </data:EntityDropDownList>
                            <data:AbAccountCodeDataSource ID="AbAccountCodeDataSource1" runat="server" SelectMethod="GetPaged">
                                <Parameters>
                                    <data:CustomParameter Name="WhereClause" Value="Kind_Pment_Desc = 'CCP'" />
                                    <data:CustomParameter Name="OrderBy" Value="Acc_Name ASC" />
                                </Parameters>
                            </data:AbAccountCodeDataSource>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Invoice Number:
                        </td>
                        <td>
                            <asp:TextBox ID="tb_InvoiceNumber" CssClass="text-input" runat="server" Width="100%"></asp:TextBox>
                        </td>
                        <td>
                            <div style="position: relative; float: right">
                                <asp:Button ID="btn_Receive" runat="server" Text="Add" CssClass="button" OnClick="btn_Receive_Click" />
                            </div>
                        </td>
                    </tr>
                </table>
            </asp:Panel>
            <h4 style="padding-top: 5px">
                Not send</h4>
            <asp:Button ID="btn_Export" runat="server" Text="Export To Excel" CssClass="button" OnClick="btn_Export_Click" /><br />
            <div style="height: 350px; overflow: scroll">
                <data:EntityGridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID=""
                    AllowMultiColumnSorting="False" DefaultSortColumnName="ReceivedDate" DefaultSortDirection="Descending"
                    AllowPaging="False" ExcelExportFileName="Export_CheckInvoice.xls" AllowExportToExcel="True"
                    AllowSorting="False" ExportToExcelText="Excel" PageSelectorPageSizeInterval="10"
                    RecordsCount="0" ShowGridOnEmptyData="False" OnRowCommand="GridView1_RowCommand">
                    <Columns>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="True" CommandName="Add"
                                    CommandArgument='<%#Bind("VatInvoiceNumber") %>' Text="Add"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="VatInvoiceNumber" HeaderText="VatInvoiceNumber" SortExpression="VatInvoiceNumber" />
                        <asp:BoundField DataField="DateVisit" HeaderText="DateVisit" SortExpression="DateVisit" />
                        <asp:BoundField DataField="PatientCode" HeaderText="PatientCode" SortExpression="PatientCode" />
                        <asp:BoundField DataField="PatientName" HeaderText="PatientName" SortExpression="PatientName" />
                        <asp:BoundField DataField="PaymentMode" HeaderText="PaymentMode" SortExpression="PaymentMode" />
                        <asp:BoundField DataField="PaymentModeRevised" HeaderText="PMode Revised" SortExpression="PaymentModeRevised" />
                        <asp:BoundField DataField="UpdPaymentDate" HeaderText="UpdPaymentDate" SortExpression="UpdPaymentDate" />
                        <asp:BoundField DataField="TotalProcedure" HeaderText="TotalProcedure" SortExpression="TotalProcedure" />
                        <asp:BoundField DataField="TotalPharmacy" HeaderText="TotalPharmacy" SortExpression="TotalPharmacy" />
                        <asp:BoundField DataField="TotalAmountVnd" HeaderText="TotalAmountVnd" SortExpression="TotalAmountVnd" />
                        <asp:BoundField DataField="TotalAmountUsd" HeaderText="TotalAmountUsd" SortExpression="TotalAmountUsd"
                            DataFormatString="{0:##0.00}" />
                        <asp:BoundField DataField="ExchangeRate" HeaderText="ExchangeRate" SortExpression="ExchangeRate" />
                    </Columns>
                    <EmptyDataTemplate>
                        <b>No Invoices Found!</b>
                    </EmptyDataTemplate>
                </data:EntityGridView>
            </div>
            <h4 style="padding-top: 5px">
                Prepare to send</h4>
            <div style="height: 350px; overflow: scroll">
                <data:EntityGridView ID="grv_PrepareToSend" runat="server" AutoGenerateColumns="False"
                    DataSourceID="" AllowMultiColumnSorting="False" DefaultSortColumnName="ReceivedDate"
                    DefaultSortDirection="Descending" AllowPaging="False" ExcelExportFileName="Export_CheckInvoice.xls"
                    AllowExportToExcel="True" AllowSorting="False" ExportToExcelText="Excel" PageSelectorPageSizeInterval="10"
                    RecordsCount="0" ShowGridOnEmptyData="False" OnRowCommand="GridView1_RowCommand">
                    <Columns>
                        <asp:TemplateField ShowHeader="False">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButton3" runat="server" CausesValidation="True" CommandName="Remove"
                                    CommandArgument='<%#Bind("VatInvoiceNumber") %>' Text="Remove"></asp:LinkButton>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="VatInvoiceNumber" HeaderText="VatInvoiceNumber" SortExpression="VatInvoiceNumber" />
                        <asp:BoundField DataField="DateVisit" HeaderText="DateVisit" SortExpression="DateVisit" />
                        <asp:BoundField DataField="PatientCode" HeaderText="PatientCode" SortExpression="PatientCode" />
                        <asp:BoundField DataField="PatientName" HeaderText="PatientName" SortExpression="PatientName" />
                        <asp:BoundField DataField="PaymentMode" HeaderText="PaymentMode" SortExpression="PaymentMode" />
                        <asp:BoundField DataField="PaymentModeRevised" HeaderText="PMode Revised" SortExpression="PaymentModeRevised" />
                        <asp:BoundField DataField="UpdPaymentDate" HeaderText="UpdPaymentDate" SortExpression="UpdPaymentDate" />
                        <asp:BoundField DataField="TotalProcedure" HeaderText="TotalProcedure" SortExpression="TotalProcedure" />
                        <asp:BoundField DataField="TotalPharmacy" HeaderText="TotalPharmacy" SortExpression="TotalPharmacy" />
                        <asp:BoundField DataField="TotalAmountVnd" HeaderText="TotalAmountVnd" SortExpression="TotalAmountVnd" />
                        <asp:BoundField DataField="TotalAmountUsd" HeaderText="TotalAmountUsd" SortExpression="TotalAmountUsd"
                            DataFormatString="{0:##0.00}" />
                        <asp:BoundField DataField="ExchangeRate" HeaderText="ExchangeRate" SortExpression="ExchangeRate" />
                    </Columns>
                    <EmptyDataTemplate>
                        <b>No Invoices Found!</b>
                    </EmptyDataTemplate>
                </data:EntityGridView>
            </div>
            <br />
            <asp:Button runat="server" ID="btn_Preview" Text="Preview" OnClick="btn_Preview_Click" />
            <asp:Button runat="server" ID="btn_Send" Text="Send" OnClick="btn_Send_Click" />
            <%--<data:AllInvoiceDataSource ID="AllInvoiceDataSource" runat="server" SelectMethod="GetPaged"
                EnablePaging="True" EnableSorting="True">
                <Parameters>
                    <data:CustomParameter Name="WhereClause" Value="Received=1 AND DATEDIFF(d,ReceivedDate,GETDATE())=0"
                        ConvertEmptyStringToNull="false" />
                    <data:CustomParameter Name="OrderByClause" Value="ReceivedDate DESC" ConvertEmptyStringToNull="false" />
                    <asp:ControlParameter Name="PageIndex" ControlID="GridView1" PropertyName="PageIndex"
                        Type="Int32" />
                    <asp:ControlParameter Name="PageSize" ControlID="GridView1" PropertyName="PageSize"
                        Type="Int32" />
                    <data:CustomParameter Name="RecordCount" Value="0" Type="Int32" />
                </Parameters>
            </data:AllInvoiceDataSource>--%>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
